package moe.oil.db.repo;

import moe.oil.db.entity.Professional;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Optional;

public interface ProfessionalRepo extends PagingAndSortingRepository<Professional, Long> {
    // 根据ID查询专业
    Optional<Professional> findByProfessionalId(Long professionalId);

    // 根据专业名查询专业
    Optional<Professional> findByName(String name);

    // 查询全部专业
    Page<Professional> findAll(Pageable pageable);

    // 根据ID删除专业
    int deleteByProfessionalId(Long professionalId);

}
